import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86185
 * Date: 2023-03-06
 * Time: 9:56
 */
public class test {
    public static void main1(String[] args) {
        for (int i = 135; i < 1000; i++) {
            int count = 0;
            int n = i;
            while(n != 0) {
                n /= 10;
                count++;
            }
            n = i;
            int sum = 0;
            while(n != 0) {
                sum += Math.pow(n%10,count);
                n /= 10;
            }
            if(sum == i) {
                System.out.println(i);
            }
        }
    }

    public static void main2(String[] args) {
        int count = 0;
        int n = 15;
//        for (int i = 1; i < 32; i++) {
//            if((n & 1) == 1) {
//                count++;
//                n>>>=1;
//            }
//        }
//        System.out.println(count);

//        while(n != 0) {
//            if((n & 1) == 1) {
//                count++;
//            }
//            n>>>=1;//-1右移1个补1，无符号补0
//        }
//        System.out.println(count);

        while(n != 0) {
            n = n & (n-1);
            count++;
        }
        System.out.println(count);
    }

    public static void main3(String[] args) {
        int n = 39;
        for (int i = 30; i >= 0; i-=2) {
            System.out.print(((n >>> i) & 1)+" ");
        }
        System.out.println();
        for (int i = 31; i >= 0; i-=2) {
            System.out.print(((n >>> i) & 1)+" ");
        }
    }
    public static boolean isLeapYear(int year){
        if((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {
            return true;
        } else {
            return false;
        }
    }

    public static void main4(String[] args) {
        boolean a = isLeapYear(2022);
        if(a) {
            System.out.println("is leap year");
        } else {
            System.out.println("is not leap year");
        }
    }
    public static int facSum(int n){
        int sum = 0;
        for (int i = 1; i <= n; i++) {
//            int ret = 1;
//            for (int j = 1; j <= i; j++) {
//                ret*=j;
//            }
            sum += fac(i);
        }
        return sum;
    }

    public static int fac(int i) {
        int ret = 1;
        for (int j = 1; j <= i; j++) {
            ret*=j;
        }
        return ret;
    }

    public static void main5(String[] args) {
        int sum = facSum(5);
        System.out.println(sum);
    }
    public static int max2(int a, int b) {
        if(a > b) {
            return a;
        } else {
            return b;
        }
    }
    public static int max3(int a, int b, int c) {
        int r = max2(a,b);
        int r2 = max2(b,c);
        return max2(r,r2);
    }

    public static void main6(String[] args) {
        int ret = max3(3,5,4);
        System.out.println(ret);
    }
    public static int fib(int n) {
        if(n<3) {
            return 1;
        } else {
            return fib(n-1)+fib(n-2);
        }

    }
    public static void main7(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int ret = fib(n);
        System.out.println(ret);
    }
    public static int sum (int a, int b) {
        return a+b;
    }
    public static double sum (double a, double b, double c) {
        return a + b + c;
    }
    public static void main9(String[] args) {
        int a = 5;
        int b = 6;
        int ret = sum(a,b);
        System.out.println(ret);

        double c = 1.3;
        double d = 8.2;
        double f = 9.6;
        double ret2 = sum(c,d,f);
        System.out.println(ret2);
    }
    public static int MAX (int a, int b) {
        return a>b?a:b;
    }
    public static double MAX (double a, double b, double c) {
        if(b > a) {
            double f = b;
            b = a;
            a = f;
        }
        if(c > a) {
            double f = c;
            c = a;
            a = f;
        }
        return a;
    }
    public static void main(String[] args) {
        int a = 4;
        int b = 6;
        int ret = MAX(a,b);
        System.out.println(ret);

        double c = 1.3;
        double d = 8.2;
        double f = 9.6;
        double ret2 = MAX(c,d,f);
        System.out.println(ret2);
    }
}
